import { MenuUnfoldOutlined, MenuFoldOutlined } from "@ant-design/icons";
import { Button } from "antd";

import { useSelector } from 'react-redux';



const HeaderLeft = ({ onCallParent, collapsed = false }) => {
    // 1. 获取状态（从 store 中取 counter 切片的 value）
    const count = useSelector((state) => state.counter.value);
  const toggleCollapsed = () => {
    onCallParent();
  };
  return (
    <>
    <Button type="text" onClick={toggleCollapsed}>
      {collapsed ? (
        <MenuUnfoldOutlined style={{ fontSize: "20px", color: "#fff" }} />
      ) : (
        <MenuFoldOutlined style={{ fontSize: "20px", color: "#fff" }} />
      )}
    </Button>
    <h3>状态值:{count}</h3>
    </>
  );
};
export default HeaderLeft;
